package com.ruoyi.cbs.black.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cbs.black.mapper.BlackRecordMapper;
import com.ruoyi.cbs.black.domain.BlackRecord;
import com.ruoyi.cbs.black.service.IBlackRecordService;

/**
 * 拉黑记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-15
 */
@Service
public class BlackRecordServiceImpl implements IBlackRecordService 
{
    @Autowired
    private BlackRecordMapper blackRecordMapper;

    /**
     * 查询拉黑记录
     * 
     * @param id 拉黑记录主键
     * @return 拉黑记录
     */
    @Override
    public BlackRecord selectBlackRecordById(Long id)
    {
        return blackRecordMapper.selectBlackRecordById(id);
    }

    /**
     * 查询拉黑记录列表
     * 
     * @param blackRecord 拉黑记录
     * @return 拉黑记录
     */
    @Override
    public List<BlackRecord> selectBlackRecordList(BlackRecord blackRecord)
    {
        return blackRecordMapper.selectBlackRecordList(blackRecord);
    }

    /**
     * 新增拉黑记录
     * 
     * @param blackRecord 拉黑记录
     * @return 结果
     */
    @Override
    public int insertBlackRecord(BlackRecord blackRecord)
    {
        blackRecord.setCreateTime(DateUtils.getNowDate());
        return blackRecordMapper.insertBlackRecord(blackRecord);
    }

    /**
     * 修改拉黑记录
     * 
     * @param blackRecord 拉黑记录
     * @return 结果
     */
    @Override
    public int updateBlackRecord(BlackRecord blackRecord)
    {
        blackRecord.setUpdateTime(DateUtils.getNowDate());
        return blackRecordMapper.updateBlackRecord(blackRecord);
    }

    /**
     * 批量删除拉黑记录
     * 
     * @param ids 需要删除的拉黑记录主键
     * @return 结果
     */
    @Override
    public int deleteBlackRecordByIds(Long[] ids)
    {
        return blackRecordMapper.deleteBlackRecordByIds(ids);
    }

    /**
     * 删除拉黑记录信息
     * 
     * @param id 拉黑记录主键
     * @return 结果
     */
    @Override
    public int deleteBlackRecordById(Long id)
    {
        return blackRecordMapper.deleteBlackRecordById(id);
    }
}
